package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.EnvironmentalArticlesMapper;
import com.ruoyi.system.domain.EnvironmentalArticles;
import com.ruoyi.system.service.IEnvironmentalArticlesService;

/**
 * articlesService业务层处理
 * 
 * @author zrj
 * @date 2025-07-11
 */
@Service
public class EnvironmentalArticlesServiceImpl implements IEnvironmentalArticlesService 
{
    @Autowired
    private EnvironmentalArticlesMapper environmentalArticlesMapper;

    /**
     * 查询articles
     * 
     * @param articleId articles主键
     * @return articles
     */
    @Override
    public EnvironmentalArticles selectEnvironmentalArticlesByArticleId(Long articleId)
    {
        return environmentalArticlesMapper.selectEnvironmentalArticlesByArticleId(articleId);
    }

    /**
     * 查询articles列表
     * 
     * @param environmentalArticles articles
     * @return articles
     */
    @Override
    public List<EnvironmentalArticles> selectEnvironmentalArticlesList(EnvironmentalArticles environmentalArticles)
    {
        return environmentalArticlesMapper.selectEnvironmentalArticlesList(environmentalArticles);
    }

    /**
     * 新增articles
     * 
     * @param environmentalArticles articles
     * @return 结果
     */
    @Override
    public int insertEnvironmentalArticles(EnvironmentalArticles environmentalArticles)
    {
        environmentalArticles.setCreateTime(DateUtils.getNowDate());
        return environmentalArticlesMapper.insertEnvironmentalArticles(environmentalArticles);
    }

    /**
     * 修改articles
     * 
     * @param environmentalArticles articles
     * @return 结果
     */
    @Override
    public int updateEnvironmentalArticles(EnvironmentalArticles environmentalArticles)
    {
        environmentalArticles.setUpdateTime(DateUtils.getNowDate());
        return environmentalArticlesMapper.updateEnvironmentalArticles(environmentalArticles);
    }

    /**
     * 批量删除articles
     * 
     * @param articleIds 需要删除的articles主键
     * @return 结果
     */
    @Override
    public int deleteEnvironmentalArticlesByArticleIds(Long[] articleIds)
    {
        return environmentalArticlesMapper.deleteEnvironmentalArticlesByArticleIds(articleIds);
    }

    /**
     * 删除articles信息
     * 
     * @param articleId articles主键
     * @return 结果
     */
    @Override
    public int deleteEnvironmentalArticlesByArticleId(Long articleId)
    {
        return environmentalArticlesMapper.deleteEnvironmentalArticlesByArticleId(articleId);
    }
}
